Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Making a transaction smaller
Try one more experiment.
How does this affect your transactions? Now that you removed the
FOR EACHblock from the larger transaction, it becomes a true transaction block of its own at block level 1, as the new listing file shows:
This means that the two transaction blocks identified by the listing are now separate and distinct transactions:
If Progress encounters an error in the update of the Order, it leaves that block and continues on with the OrderLines. If the OrderLines update succeeds, then the newly modified OrderLines are in the database, but the failed Order update is not. Likewise, if the Order block succeeds but there is an error in the OrderLines block, then the Order update is in the database but the OrderLines update is not. You must decide when you put your procedures together how large your updates need to be to maintain your data integrity. In general, you should work to keep your transactions as small as possible so that you do not lock more records or lock records for longer periods of time than is absolutely necessary. But your transactions must be large enough so that related changes that must be committed together either all get into the database or are all rejected.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |